﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.NeighborUI {
    import flash.events.*;
    import flash.display.*;
    import Events.*;
    import org.aswing.*;
    import Classes.*;
    import Display.*;
    import org.aswing.event.*;
    import Display.aswingui.*;

    public class NeighborVisitGiftHireMenu extends Sprite {

        protected var m_friend:Friend;
        public var m_jwindow:JWindow;

        public function NeighborVisitGiftHireMenu(_arg1:Friend){
            this.m_friend = _arg1;
            this.createBackground();
        }
        public function get friend():Friend{
            return (this.m_friend);
        }
        public function set friend(_arg1:Friend):void{
            this.m_friend = _arg1;
        }
        private function createBackground():void{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP, 3);
            addEventListener(MouseEvent.MOUSE_OVER, this.onMaskNeighborActions, false, 0, true);
            addEventListener(MouseEvent.MOUSE_MOVE, this.onMaskNeighborActions, false, 0, true);
            addEventListener(MouseEvent.MOUSE_OUT, this.onMaskNeighborActions, false, 0, true);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP, 3);
            ASwingHelper.setEasyBorder(_local2, 20, 20, 0, 6);
            var _local3:CustomButton = new CustomButton(ZLoc.t("Dialogs", "Visit"), null, "GreenSmallButtonUI");
            var _local4:CustomButton = new CustomButton(ZLoc.t("Dialogs", "Gift"), null, "GreenSmallButtonUI");
            var _local5:ASFont = _local4.getFont();
            _local4.setFont(_local5.changeSize(TextFieldUtil.getLocaleFontSizeByRatio(_local5.getSize(), 1, [{
                locale:"pt",
                ratio:0.8
            }])));
            _local3.addActionListener(this.visitNeighbor, 0, true);
            _local4.addActionListener(this.giftNeighbor, 0, true);
            var _local6:DisplayObject = (new EmbeddedArt.neighborActionsBG() as DisplayObject);
            ASwingHelper.setSizedBackground(_local1, _local6);
            _local2.append(_local3);
            if (this.m_friend.fake != true){
                _local2.append(_local4);
            };
            _local1.append(_local2);
            this.m_jwindow = new JWindow(this);
            this.m_jwindow.setContentPane(_local1);
            this.m_jwindow.show();
            ASwingHelper.prepare(this.m_jwindow);
        }
        public function onMaskNeighborActions(_arg1:MouseEvent):void{
            _arg1.stopImmediatePropagation();
            _arg1.stopPropagation();
        }
        private function visitNeighbor(_arg1:AWEvent):void{
            dispatchEvent(new FriendTradeEvent(FriendTradeEvent.VISIT, this.m_friend));
        }
        private function giftNeighbor(_arg1:AWEvent):void{
            dispatchEvent(new FriendTradeEvent(FriendTradeEvent.GIFT, this.m_friend));
        }
        private function hireNeighbor(_arg1:AWEvent):void{
            dispatchEvent(new FriendTradeEvent(FriendTradeEvent.HIRE, this.m_friend));
        }

    }
}//package Display.NeighborUI 
